<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<select id="pro">
    <option value="">请选择</option>
    <?php if(is_array($pro)): $i = 0; $__LIST__ = $pro;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><option value="<?php echo ($v["aid"]); ?>"><?php echo ($v["aname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
</select>
<select  id="city">
    <option value="">请选择</option>
</select>
<select  id="area">
    <option value="">请选择</option>
</select>
<script src="/Public/jquery.min.js"></script>
<script>
    $(function(){
        $('#pro').change(function(){
          var aid=$('#pro option:selected').val();
            $.get('<?php echo U("getAddr");?>',{id:aid},function(data){
                var html='<option value="">请选择</option>';
                    for(var i  in data){
                    //console.log(data[i].aid);
                    html +='<option value="'+data[i].aid+'">'+data[i].aname+'</option>';
                }
                $('#city').html(html);
            });
        });
        $('#city').change(function(){
            var aid=$('#city option:selected').val();
            $.get('<?php echo U("getAddr");?>',{id:aid},function(data){
                var html='<option value="">请选择</option>';
                for(var i in data){
                    //console.log(data[i].aid);
                    html +='<option value="'+data[i].aid+'">'+data[i].aname+'</option>';
                }
                $('#area').html(html);
            });
        });
    })

</script>
</body>
</html>